<div style="width:670px; float:left; padding-left:5px; margin-left:5px; min-height:500px" class="border_radius">

<?php

	include_once("../../coms/xl_thongtin.php");

	include_once("../../include/ckeditor/ckeditor.php");

	$bn = new xl_thongtin();

	$arr_bn = $bn->Load_DiaChi();

	

	if(isset($_REQUEST['act']) && isset($_REQUEST['id'])):

		$act = $_REQUEST['act'];

		$id = $_REQUEST['id'];

		$maloaitrang = $_REQUEST['malt'];

		if($act == 'del' && is_numeric($id)):

			$xoa = new xl_thongtin();

			$kq2 = $xoa->Xoa_Thong_Tin_Theo_Loai_Trang_va_ID($maloaitrang, $id);			

			echo '<script type="text/javascript">

						alert("Xóa địa chỉ thành công!!!");	

						window.location="trangchu.php?key=qldc";				

					</script>';

		endif;

	endif;		

?>

   
<div class="content_right_title_admin">
Quản lý địa chỉ
</div>      
<div class="content_right_group_admin box_shadow" style="padding-bottom:5px">
<table width="100%" cellspacing="0" style="padding-left:5px; padding-right:5px">

	<tr bgcolor="#999">

    	<th align="center" valign="middle">

        	STT

        </th>

    	<th align="center" valign="middle">

        	Tên địa chỉ

        </th>

        <th align="center" valign="middle">

        	Thông tin địa chỉ

        </th>

        <th align="center" valign="middle">

        	Chức năng

        </th>

    </tr>

<?php

for ($i=0; $i<count($arr_bn); $i++):

	$row = $arr_bn[$i];

?>

    <tr style="border-bottom:#666;background-color:#CCC">

    	<td align="center" valign="middle">

        	<?php echo $i+1; ?>

        </td>

        <td align="center" valign="middle">

        	<?php echo $row['tenthongtin']; ?>

        </td>

    	<td align="center" valign="middle">

        	

            <table width="100%" cellpadding="0" cellspacing="0">

            	<tr>

                	<td style="color:#333">

                    	<?php 

							echo $row['noidung'];

						?>

                    						

                    </td>

                </tr>

            </table>

            

        </td>

        <td align="center" valign="middle">

       		<a href="trangchu.php?key=sdc&act=upd&malt=8&id=<?php echo $row['mathongtin']; ?>" class="button medium blue">Sửa</a>

        	<a href="trangchu.php?key=qldc&act=del&malt=8&id=<?php echo $row['mathongtin']; ?>" class="button medium blue" onclick="javascript: return confirm('Bạn chắc muốn xóa địa chỉ này không?');">Xóa</a>

        </td>

    </tr>

<?php

endfor;

?>

</table><br>






</div>
</div>





<?php

 

if(isset($_POST['btn_upload']))

{

	$tendiachi = $_POST['txt_tenthongtin'];

	$noidung = $_POST['noidung'];

	$upload = new xl_thongtin();

	$ketqua = $upload->ThemDiaChi($tendiachi, $noidung);

	echo '<meta http-equiv="refresh" content="0;url=trangchu.php?key=qldc" />';

	

}



?>